package zua.program.androidstudioprogram01;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class RegisterActivity extends AppCompatActivity {
    TextView register1,input_username,input_password,input_petName;
    Button OK_and_back;

    @SuppressLint("MissingInflatedId")
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);

        register1 = findViewById(R.id.register1);
        input_username = findViewById(R.id.input_username);
        input_password = findViewById(R.id.input_password);
        input_petName = findViewById(R.id.input_petName);
        OK_and_back = findViewById(R.id.OK_and_back);

        OK_and_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String str1 = input_username.getText().toString();
                String str2 = input_password.getText().toString();
                String str3 = input_username.getText().toString();
                Intent intent = new Intent(RegisterActivity.this,MainActivity.class);
                intent.putExtra("username",str1);
                intent.putExtra("password",str2);
                intent.putExtra("petname",str3);
                startActivity(intent);
            }
        });

    }
}
